//
//  AddCarViewController.m
//  YaDiuDiu
//
//  Created by 欧洪飞 on 2017/9/2.
//  Copyright © 2017年 jy. All rights reserved.
//

#import "AddCarViewController.h"

#import "AddCarManaView.h"
@interface AddCarViewController ()<UIScrollViewDelegate>

@end

@implementation AddCarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setBGColor];
    [self showNav:@"添加商品"];
    [self loadUI];
    
}

- (void)loadUI{
    UIView *footView = [[UIView alloc] initWithFrame:CGRectMake(0, ScreenHeight-90, ScreenWidth, 90)];
    footView.backgroundColor = COLOR_RGB(242, 242, 242, 1);
    [self.view addSubview:footView];
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(20, 20, ScreenWidth-40, 45);
    btn.backgroundColor = [UIColor redColor];
    [btn setTitle:@"提交" forState:UIControlStateNormal];
    btn.layer.cornerRadius = 5.0;
    [footView addSubview:btn];
    
    UIScrollView *scl = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 64, ScreenWidth, ScreenHeight-64-90)];
    scl.contentSize = CGSizeMake(ScreenWidth, 1150);
    scl.delegate = self;
    [self.view addSubview:scl];
    
    AddCarManaView *views = [[[NSBundle mainBundle] loadNibNamed:@"AddCarManaView" owner:nil options:nil] lastObject];
    views.frame = CGRectMake(0, 0, ScreenWidth, 1150);
    [scl addSubview:views];
    
    
}

-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
    [[UIApplication sharedApplication].keyWindow endEditing:YES];
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [[UIApplication sharedApplication].keyWindow endEditing:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
